<%@page import="com.muk.meis.model.bean.UserProfile"%>
<%@page import="com.muk.meis.MEISConstance"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.muk.meis.model.service.SchoolInfoService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MEIS</title>
<link href="layout.css" rel="stylesheet" type="text/css">
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/flot/excanvas.min.js"></script><![endif]-->
<link href="css/dropdown/themes/default/helper.css" media="screen" rel="stylesheet" type="text/css" />
<!-- Beginning of compulsory code below -->

<link href="css/dropdown/dropdown.css" media="screen" rel="stylesheet" type="text/css" />
<link href="css/dropdown/themes/default/default.css" media="screen" rel="stylesheet" type="text/css" />

<link type="text/css" href="css/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" />	
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jquery/jquery-ui-1.8.16.custom.min.js"></script>

<!--[if lt IE 7]>
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jquery/jquery.dropdown.js"></script>
<![endif]-->

<!-- / END -->

<script language="javascript" type="text/javascript"
	src="js/flot/jquery.flot.js"></script>
<style type="text/css">
.mesi_header_m {
	color: #F00;
}
</style>
</head>
<body>
	<form action="LoginController/login">
       <%
       UserProfile userPassLogin =  (UserProfile)session.getAttribute(MEISConstance.USER_PASS_LOGIN);
       if(userPassLogin == null){
       %>
       <div style="position:relative;background-image: url('image/header_background.gif'); width:1000px; height:140px; color: #333;font-size:25px;">
           <div style="width:800px; padding-left:50px;padding-top:50px;"><span class="mesi_header_m">M</span>ukdahan education information system</div>
       </div>
       <div style="position:relative;padding-left:100px;padding-top:60px;width:1000px;"> 
	       <div style="position:relative;float:left;width:250px;padding-top: 30px;padding-right: 50px;">
	       <table>
	       		<tr><td></td></tr>
	       		<tr><td></td></tr>
	       </table>  
	       	  <div class="ui-widget-header" style="height: 30px;">
	       	  	<span style="">เข้าใช้</span>
	       	  </div> 
	       	  <table>
	       	  	<tr>
	       	  		<td>ชื่อผู้ใช้</td>
	       	  		<td><input type="text" name="username" width="10"/></td>
	       	  	</tr>
	       	  	<tr style="position:relative;padding-top:10px;">
	       	  		<td>รหัสผ่าน</td>
	       	  		<td><input type="password" name="password" width="10"/></td>
	       	  	</tr>
	       	  </table>
	       	  <input type="submit" name="ok" value="ตกลง"/>
	       </div>
	       
          <div style="position:relative;float: right;display: block;">
	       <%} else {%>		           
	          <jsp:include page="menu.jsp"></jsp:include>
	          <div style="position:relative;padding-top:60px;padding-left:300px;">
	       <%} %>
		       <table id="mainTable" cellspacing="0">
		            <tr style="background-image:url(image/header_table_background.jpg)" height="30px;">
		                <td align="center">ลำดับ </td>
		                <td align="center" width="80px">รหัสโรงเรียน</td>                                               
		                <td align="center">ชื่อโรงเรียน</td>                                               
		                <td align="center">ตำบล</td>                                               
		            </tr>
			       <%
			       SchoolInfoService schoolInfoService = new SchoolInfoService();
			       List lst = schoolInfoService.getSchoolName("");
			       int couter = 1;
			       for (Iterator iterator = lst.iterator(); iterator.hasNext();) {
			    	   Object [] schoolInfo = (Object[]) iterator.next();
			       %>
			       
			           <tr>
				           		<td align="center"><a href="<%="NewsController/list?percode="+schoolInfo[3]%>"><%=couter++%></a></td>
				           		<td align="center"><a href="<%="NewsController/list?percode="+schoolInfo[3]%>"><%=schoolInfo[3]%></a></td>
				           		<td><a href="<%="NewsController/list?percode="+schoolInfo[3]%>"><%=schoolInfo[0]%></a></td>
				           		<td><a href="<%="NewsController/list?percode="+schoolInfo[3]%>"><%=schoolInfo[1]%></a></td>
			           </tr>
			       <%} %>
		       </table>
	         </div> 
	     <%if(userPassLogin == null){ %>
           </div>
         <%} %>
         <jsp:include page="footer.jsp"></jsp:include>		                 
	</form>
</body>
</html>